package net.bwie.reatime.jtp.mapper;

import net.bwie.reatime.jtp.bean.TrafficChannelPvBean;
import net.bwie.reatime.jtp.bean.TrafficChannelUvBean;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TrafficChannelStatsService {
    @Select("SELECT channel, sum(pv_count) AS uv_count\n" +
            "FROM jtp_log_report.dws_traffic_page_view_window_report\n" +
            "WHERE toDate(timestamp) = #{date}\n" +
            "GROUP BY channel"
    )
    List<TrafficChannelPvBean> selectPvCount(@Param("date")String date);
    @Select("SELECT channel, sum(uv_count) AS uv_count\n" +
            "FROM jtp_log_report.dws_traffic_page_view_window_report\n" +
            "WHERE toDate(window_start_time) = #{date}\n" +
            "GROUP BY channel"
    )
    List<TrafficChannelUvBean> selectUvCount(@Param("date")String date);

}
